import { request, config } from 'utils'

const { api } = config
const { sysUserList, sysUserListAll, sysUserAdd, sysResetPassword, sysSetAccoutState, sysCurrentUser, sysUserEdit, sysUserQuery, sysUserDel, sysUserMultiDel, sysUserChangePassword } = api

export async function list (params) {
  return request({
    url: sysUserList,
    method: 'post',
    data: params,
  })
}

export async function listall (params) {
  return request({
    url: sysUserListAll,
    method: 'post',
    data: params,
  })
}

export async function query (params) {
  return request({
    url: sysUserQuery,
    method: 'put',
    data: params,
  })
}


export async function create (params) {
  return request({
    url: sysUserAdd,
    method: 'post',
    data: params,
  })
}

export async function update (params) {
  return request({
    url: sysUserEdit,
    method: 'put',
    data: params,
  })
}
export async function remove (params) {
  return request({
    url: sysUserDel,
    method: 'delete',
    data: params,
  })
}

export async function patchremove (params) {
  return request({
    url: sysUserMultiDel,
    method: 'delete',
    data: params,
  })
}

export async function UserChangePassword (params) {
  return request({
    url: sysUserChangePassword,
    method: 'put',
    data: params,
  })
}

export async function getCurrentUser (params) {
  return request({
    url: sysCurrentUser,
    method: 'get',
    data: params,
  })
}

export async function UserResetPassword (params) {
  return request({
    url: sysResetPassword,
    method: 'put',
    data: params,
  })
}

export async function UserSetState (params) {
  return request({
    url: sysSetAccoutState,
    method: 'put',
    data: params,
  })
}
